import {setAxios} from '@/axios/index'

//获取验证码的接口
export const signUpCode = (params: { to: string }) => setAxios('/user/signUpCode', 'post', params)

export const signUp = (params: {
  email: string,
  code: string,
  password: string,
  inviteCode?: string
}) => setAxios('/user/signUp', 'post', params)

export const signIn = (params: { email: string, password: string }): Promise<API.InsRes<{
  accessToken: string
}>> => setAxios('/user/signIn', 'post', params)

export const getInviteCode = (): Promise<API.InsRes<{code: string}>> => setAxios('/user/inviteCode', 'get')
